﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

[Index("m_attribute", Name = "m_attribute")]
[Index("m_guid", Name = "m_guid")]
[Index("m_status", Name = "m_status")]
[Index("m_type_guid", Name = "m_type_guid")]
[MySqlCharSet("utf8mb3")]
[MySqlCollation("utf8mb3_general_ci")]
public partial class iot_device_model
{
    [Key]
    public long m_id { get; set; }

    /// <summary>
    /// 设备型号编号，很重要，代码里判断设备型号
    /// </summary>
    [Required]
    [StringLength(50)]
    public string m_code { get; set; }

    /// <summary>
    /// 0正常，1禁用
    /// </summary>
    public int m_status { get; set; }

    [Required]
    public string m_guid { get; set; }

    /// <summary>
    /// 类型名称
    /// </summary>
    [StringLength(100)]
    public string m_name { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? m_add_time { get; set; }

    /// <summary>
    /// 客户
    /// </summary>
    [StringLength(50)]
    public string m_c_guid { get; set; }

    /// <summary>
    /// iot_device_model_Type
    /// </summary>
    [Required]
    [StringLength(50)]
    public string m_type_guid { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [Column(TypeName = "text")]
    public string m_remark { get; set; }

    /// <summary>
    /// 买来源
    /// </summary>
    [StringLength(255)]
    public string m_buy_from { get; set; }

    /// <summary>
    /// 供应商
    /// </summary>
    [StringLength(255)]
    public string m_supply_from { get; set; }

    /// <summary>
    /// 品牌
    /// </summary>
    [StringLength(255)]
    public string m_brand { get; set; }

    /// <summary>
    /// 1执行器，2传感器，3网关,4延时，模拟，5显示
    /// </summary>
    public int? m_attribute { get; set; }

    /// <summary>
    /// 协议名称
    /// </summary>
    [StringLength(255)]
    public string m_agreementType { get; set; }

    /// <summary>
    /// 协议ID
    /// </summary>
    [StringLength(200)]
    public string m_agreement_guid { get; set; }

    /// <summary>
    /// 指令解说
    /// </summary>
    [Column(TypeName = "text")]
    public string m_command_explain { get; set; }

    /// <summary>
    /// 参数模板
    /// </summary>
    [Column(TypeName = "text")]
    public string m_parameter_demo { get; set; }

    /// <summary>
    /// 初始化
    /// </summary>
    [Column(TypeName = "text")]
    public string m_parameter_demo_init { get; set; }

    /// <summary>
    /// 数据值说明备注
    /// </summary>
    [StringLength(500)]
    public string m_value_remark { get; set; }
}
